package br.com.ximp.addessi.server.service;

import br.com.ximp.addessi.server.dao.UsuarioDAO;
import br.com.ximp.addessi.shared.entity.Usuario;
import br.com.ximp.addessi.shared.service.UsuarioSvc;

import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class UsuarioSvcImpl extends RemoteServiceServlet implements UsuarioSvc{

	@Override
	public Usuario getUsuario() {
		UserService userService = UserServiceFactory.getUserService();		
		String email = userService.getCurrentUser().getEmail();
		UsuarioDAO usuarioDAO = Objectory.getUsuarioDAO();		
		return usuarioDAO.getByEmail(email);
	}

}
